package cn.pconline.autoclub.entity;

import org.gelivable.dao.Column;
import org.gelivable.dao.Entity;
import org.gelivable.dao.Id;

import cn.pconline.autoclub.util.EncodeUtils;

import com.alibaba.fastjson.JSONObject;

/**
 * 活动地点实体
 * @author zhoutianhuai
 *
 */
@Entity(tableName = "ac_activity_place")
public class ActivityPlace {


  @Id
  @Column(name = "place_id")
  /**活动地点id**/
  private long placeId;
  
  @Column(name = "activity_id")
  /**所属活动Id**/
  private long activityId;
  
  @Column(name = "type")
  /** 地点类型 1：集合地点；2目的地点**/
  private int type;
  
  @Column(name = "name")
  /**地点名称**/
  private String name;
  
  @Column(name = "longitude")
  /**经度**/
  private double longitude;
  
  @Column(name = "latitude")
  /** 纬度**/
  private double latitude;
  
  @Column(name = "seq")
  private int seq;  // 排序
  
  @Column(name = "mark_name")
  private String markName;  // 地点别名
  
  /**地点类型 ：目的地点**/
  public final static int TYPE_DESTINATION = 2; 
  /**地点类型 ：集合地点**/
  public final static int TYPE_GATHERING = 1; 

  
public String getMarkName() {
	return markName;
}

public void setMarkName(String markName) {
	this.markName = markName;
}

public long getPlaceId() {
	return placeId;
}

public void setPlaceId(long placeId) {
	this.placeId = placeId;
}

public long getActivityId() {
	return activityId;
}

public void setActivityId(long activityId) {
	this.activityId = activityId;
}

public int getType() {
	return type;
}

public void setType(int type) {
	this.type = type;
}

public String getName() {
	return name;
}

public void setName(String name) {
	this.name = name;
}

public double getLongitude() {
	return longitude;
}

public void setLongitude(double longitude) {
	this.longitude = longitude;
}

public double getLatitude() {
	return latitude;
}

public void setLatitude(double latitude) {
	this.latitude = latitude;
}

  
public int getSeq() {
	return seq;
}

public void setSeq( int seq ) {
	this.seq = seq;
}

public JSONObject toJson(){
	JSONObject jsonObject = new JSONObject();
	jsonObject.put("name",getName());
	jsonObject.put("longitude",getLongitude());
	jsonObject.put("latitude",getLatitude());
	jsonObject.put("markName",getMarkName());
	return jsonObject;
}

public JSONObject toJsonEncodeHTML() {
	JSONObject jsonObject = new JSONObject();
	jsonObject.put("name",EncodeUtils.encodeForHTMLFilterNull(getName()));
	jsonObject.put("longitude",getLongitude());
	jsonObject.put("latitude",getLatitude());
	jsonObject.put("markName",getMarkName());
	return jsonObject;
}
  
}
